package frontend.parser.syntaxtree;

import frontend.lexer.TKType;
import frontend.parser.syntaxtree.symbol.NonTerminalSymbol;
import frontend.parser.syntaxtree.symbol.TerminalSymbol;

import java.util.function.Consumer;

public class MainFuncDefNode extends SyntaxNode {
    public BlockNode mainBlock;

    @Override
    public void walk(Consumer<TerminalSymbol> terConsumer, Consumer<NonTerminalSymbol> nonTerConsumer) {
        terConsumer.accept(new TerminalSymbol(TKType.INTTK));
        terConsumer.accept(new TerminalSymbol(TKType.MAINTK));
        terConsumer.accept(new TerminalSymbol(TKType.LPARENT));
        terConsumer.accept(new TerminalSymbol(TKType.RPARENT));

        mainBlock.walk(terConsumer, nonTerConsumer);

        nonTerConsumer.accept(new NonTerminalSymbol(this));
    }

    @Override
    public String getType() {
        return "MainFuncDef";
    }
}
